A Simple CPS Transformation of Control-Flow Information

نویسندگان

  • Daniel Damian
  • Olivier Danvy
چکیده

We build on Danvy and Nielsen’s first-order program transformation into continuation-passing style (CPS) to design a new CPS transformation of flow information that is simpler and more efficient than what has been presented in previous work. The key to simplicity and efficiency is that our CPS transformation constructs the flow information in one go, instead of first computing an intermediate result and then exploiting it to construct the flow information. More precisely, we show how to compute control-flow information for CPStransformed programs from control-flow information for direct-style programs and vice-versa. As a corollary, we confirm that CPS transformation has no effect on the control-flow information obtained by constraint-based control-flow analysis. The transformation has immediate applications in assessing the effect of the CPS transformation over other analyses such as, for instance, binding-time analysis.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

CPS transformation of flow information , Part II : administrative reductions ∗ DANIEL

We characterize the impact of a linear β-reduction on the result of a control-flow analysis. (By ‘a linear β-reduction’ we mean the β-reduction of a linear λ-abstraction, i.e., of a λabstraction whose parameter occurs exactly once in its body.) As a corollary, we consider the administrative reductions of a Plotkin-style transformation into Continuation-Passing Style (CPS), and how they affect t...

متن کامل

On Static and Dynamic Control-Flow Information in Program Analysis and Transformation

This thesis addresses several aspects of static and dynamic control-flow information in programming languages, by investigating its interaction with program transformation and program analysis. Control-flow information indicates for each point in a program the possible program points to be executed next. Control-flow information in a program may be static, as when the syntax of the program dire...

متن کامل

CPS transformation of flow information, Part II: administrative reductions

We characterize the impact of a linear β-reduction on the result of a control-flow analysis. (By “a linear β-reduction” we mean the β-reduction of a linear λ-abstraction, i.e., of a λ-abstraction whose parameter occurs exactly once in its body.) As a corollary, we consider the administrative reductions of a Plotkinstyle transformation into continuation-passing style (CPS), and how they affect t...

متن کامل

A First-Order One-Pass CPS Transformation

We present a new transformation of call-by-value lambda-terms into continuation-passing style (CPS). This transformation operates in one pass and is both compositional and first-order. Because it operates in one pass, it directly yields compact CPS programs that are comparable to what one would write by hand. Because it is compositional, it allows proofs by structural induction. Because it is f...

متن کامل

CPS transformation of flow information

We consider the question of how a continuation-passing-style (CPS) transformation changes the ow analysis of a program. We present an algorithm that takes the least solution to the ow constraints of a program and constructs in linear time the least solution to the ow constraints for the CPS-transformed program. Previous studies of this question used CPS transformations that had the e ect of dup...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Logic Journal of the IGPL

دوره 10  شماره 

صفحات  -

تاریخ انتشار 2002